home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 3761 < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.0 KB  |  36 lines

  1. Path: news.uh.edu!usenet
  2. From: Sensarn <txs53132@bayou.uh.edu>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: how to pass matrix to function turbo c++?
  5. Date: 25 Jan 1996 22:54:08 GMT
  6. Organization: AEtna Insurance Agency
  7. Message-ID: <4e91mg$iup@masala.cc.uh.edu>
  8. References: <4e7ftm$11n@newsbf02.news.aol.com>
  9. NNTP-Posting-Host: sip-14125.public-dialups.uh.edu
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.1 (Windows; U; 16bit)
  14.  
  15. I'm not sure if I understand what you want, but I think you want to send 
  16. a copy of the array to the function.  Use a pointer:
  17.  
  18. //This is just an example
  19. void multiply(int *number,float factor);
  20.  
  21. void main(void)
  22. {
  23.     int number=10; //Number is equal to 10 now
  24.     multiply(&number,2) //Send address of variable to function
  25.     while(number==10); //This loop will not do anything because number
  26.                        //equals 20
  27. }
  28.  
  29. void multiply(int *number,float factor)
  30. {
  31.     *number*=factor;
  32. }
  33.  
  34. Steven Sensarn - txs53132@bayou.uh.edu
  35.  
  36.